clear
use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 6 Regionalism\Data\CIs Mexico.dta"

*Figure 6.7
twoway (bar pointestimate2 var9 if var5==1, base(0) barwidth(.75) color(black) lwidth(none)) ///
(bar pointestimate2 var9 if var5==2, base(0.5748) barwidth(.75) color(gs6) lwidth(none)) ///
(bar pointestimate2 var9 if var5==3, base(0.709) barwidth(.75) color(gs10) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==4, base(0.97859) barwidth(.75) color(gs16) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==5, base(0) barwidth(.75) color(black) color(black) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==6, base(0.22) barwidth(.75) color(gs6) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==7, base(0.5575) barwidth(.75) color(gs10) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==8, base(0.97482) barwidth(.75) color(gs16) lwidth(none)) ///
 (scatter label var15, mlab(candidate) msymbol(none) mlabcolor(white) mlabpos(0)) ,  xtitle("{bf:Ego's State of Residence}") xlab(1 "Guanajuato" 2 "Guerrero") ///
graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black)) ///
ytitle("{bf:Model-Predicted Percentage (cumulative)}" "{bf:among Alters in Ego's Network}")  legend(off) ylab(0 "0%" .2 "20%" .4 "40%" .6 "60%" .8 "80%" 1 "100%")

graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 6 Regionalism\Figures\Mexico Disc Choice CIs.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR6_7.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR6_7.pdf", as(pdf) replace 
 *(rcap lowerci_cum upperci_cum var13, color(black))  ///
